package com.ccc.test.weibo;// HotItem.java

import cn.hutool.core.date.DateTime;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class HotItem {
    // 基础信息
    private String id;
    private String title;
    private String rank;
    private String hotValue;
    private PlatformType platform;

    // 标签信息
    private String tag; // 热、爆、新、荐等
    private String tagColor;
    private boolean isAd; // 是否是广告

    // 链接信息
    private String url;
    private String mobileUrl;

    // 趋势信息
    private String trend; // up, down, new
    private String trendValue; // 变化值

    // 时间信息
    private DateTime crawlTime;
    private DateTime updateTime;

    // 扩展信息
    private String description;
    private String imageUrl;
    private List<String> relatedKeywords;

    public HotItem() {
        this.crawlTime = DateTime.now();
        this.updateTime = DateTime.now();
        this.relatedKeywords = new ArrayList<>();
    }

    // 构造方法、getters、setters
    public static HotItem create(PlatformType platform, String rank, String title, String hotValue) {
        HotItem item = new HotItem();
        item.platform = platform;
        item.rank = rank;
        item.title = title;
        item.hotValue = hotValue;
        item.id = platform.getCode() + "_" + rank + "_" + System.currentTimeMillis();
        return item;
    }
}
